package com.sjp.service.impl;

import com.sjp.dao.CommentMapper;
import com.sjp.pojo.Comment;
import com.sjp.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public int count(Integer blogId) {
        return commentMapper.count(blogId);
    }

    @Override
    public int addComment(Comment comment) {
        return commentMapper.addComment(comment);
    }

    @Override
    public List<Comment> queryComments(Integer blogId) {
        return commentMapper.queryComments(blogId);
    }

    @Override
    public int countTotal() {
        return commentMapper.countTotal();
    }

    @Override
    public List<Comment> queryAllComments() {
        return commentMapper.queryAllComments();
    }

    @Override
    public int deleteComments(Integer[] ids) {
        return commentMapper.deleteComments(ids);
    }

    @Override
    public boolean reply(Integer id, String replyBody) {
        return commentMapper.reply(id, replyBody);
    }

}
